import { View, Image } from "@tarojs/components"
import { Icon } from '@antmjs/vantui'

import './complete-dialog.less'

const CompleteDialog = props => {
  return (
    props.show ?
    (
      <View className='dialog-mask-box'>
        <View className='dialog-box'>
          <View className='go-back'>
            <Icon name='arrow-left' />
          </View>
          <View className='img-box'>
            <Image 
              className='state-img' 
              src={require(`../../static/images/dialog-${props.res.code !== 0 ? 'success':'fail'}.png`)} 
            />
          </View>
          <View className=''></View>
        </View>
      </View>
    ):
    ''
  )
}

CompleteDialog.defaultProps = {
  show: false,
  res: {
    code:1,
    msg: ''
  }
}

export default CompleteDialog